package com.atguigu.day07.test;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/6 14:28
 * @注释
 */
public class Dog {
    String name;
    char gender;
    String color;
    public void eat(){
        System.out.println("啥都吃");
    }
    public void sleep(){
        System.out.println("吃饱了，休息一会");
    }
    public void work(){
        System.out.println("小狗可以看家护院");
    }
}

class DogTest{
    public static void main(String[] args) {
        Dog dog1 = new Dog();
        dog1.name = "花花";
        dog1.gender = '公';
        dog1.color = "黑白相间";
        System.out.println("名字：" + dog1.name);
        System.out.println("性别：" + dog1.gender);
        System.out.println("花色：" + dog1.color);
        dog1.eat();
        dog1.sleep();
        dog1.work();
        System.out.println("--------------------------");
        Dog dog2 = new Dog();
        dog2.name = "旺财";
        dog2.gender = '公';
        dog2.color = "黄色";
        System.out.println("名字：" + dog2.name);
        System.out.println("性别：" + dog2.gender);
        System.out.println("花色：" + dog2.color);
        dog2.eat();
        dog2.sleep();
        dog2.work();
    }
}